<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    const p = Promise.resolve('OK')
    // 如果传入的参数是 非Promise类型的对象 ，那么返回的结果是成功的回调
    // 如果传入的参数是 Promise类型的对象 ，那么参数的结果决定了resolve的结果
    const p2 = Promise.resolve(new Promise((resolve, reject) => {
        // resolve('ok')
        reject('err')
    }))
    console.log(p2);
    p2.catch((reason) => {
        console.log(reason);
    })
    console.log(p);
</script>

</html>